#ifndef LAYERMANAGER_H
#define LAYERMANAGER_H

#include <QObject>

class Layer;

class LayerManager : public QObject
{
	Q_OBJECT

public:
	LayerManager(QSize size, QObject *parent = 0);
	~LayerManager();

	QPointer<Layer> mainLayer() const;

	QPointer<Layer> addLayer(const QString& strLayerName = QString());
	QPointer<Layer> layer(const QString& name) const;
	bool removeLayer(const QString& name);

	unsigned int layerCount() const;

	void paint(QPainter& painter);

	const QSize size() const;
private:
	QList<QPointer<Layer> > m_layers;
	QPointer<Layer> m_mainLayer;
	// layer size, same for all layers
	QSize m_size;
signals:
	void layerAdded(QPointer<Layer> layer);
	void layerRemoved(QPointer<Layer> layer);
};

#endif // LAYERMANAGER_H
